package com.iuie.ns.datum.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.iuie.ns.system.vo.code.SysCodeInfoVO;

/**
 * @desc TODO
 * @createTime 2017年8月18日 上午11:20:08
 * @author iuie
 */
@Table(name = "NS_BLOG_INFO")
@Entity
public class BlogInfoVO implements Serializable{

    private static final long serialVersionUID = -717672218353371778L;

    @Id
	private Long blogId;

	private String blogName;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime = new Date();

	private Integer visits=0;

	private String author;
	
	private String authorId;

	private String remarks;

	private SysCodeInfoVO blogType;

	@JoinColumn(name="fileInfo",referencedColumnName="fileId")
	@OneToOne(fetch=FetchType.EAGER)
	private FileInfoVO fileInfo;

	private String link;

	public Long getBlogId() {
		return blogId;
	}

	public void setBlogId(Long blogId) {
		this.blogId = blogId;
	}

	public String getBlogName() {
		return blogName;
	}

	public void setBlogName(String blogName) {
		this.blogName = blogName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getVisits() {
		return visits;
	}

	public void setVisits(Integer visits) {
		this.visits = visits;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public SysCodeInfoVO getBlogType() {
		return blogType;
	}

	public void setBlogType(SysCodeInfoVO blogType) {
		this.blogType = blogType;
	}

	public FileInfoVO getFileInfo() {
		return fileInfo;
	}

	public void setFileInfo(FileInfoVO fileInfo) {
		this.fileInfo = fileInfo;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}
	
    public String getAuthorId() {
        return authorId;
    }
    
    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }

    @Override
    public String toString() {
        return "BlogInfoVO [blogId=" + blogId + ", blogName=" + blogName + ", createTime=" + createTime + ", visits=" + visits + ", author=" + author + ", authorId=" + authorId
                + ", remarks=" + remarks + ", blogType=" + blogType + ", fileInfo=" + fileInfo + ", link=" + link + "]";
    }

}
